package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.hardware.computer.ComputerType;

public class ComputerTypeMapper implements RowMapper<ComputerType> {

	@Override
	public ComputerType mapRow(final ResultSet result, final int row) throws SQLException {
	    
	    ComputerType computerType = new ComputerType();
		
	    computerType.setIdComputer(result.getInt("idComputer"));
	    computerType.setName(result.getString("name"));
	    computerType.setMaxFirewalls(result.getInt("maxFirewalls"));
	    computerType.setMaxHardDisks(result.getInt("maxHardDisks"));
	    computerType.setMaxNetworkCards(result.getInt("maxNetworkCards"));
	    computerType.setMaxPowerSupplies(result.getInt("maxPowerSupplies"));
	    computerType.setMaxProcessors(result.getInt("maxProcessors"));
	    computerType.setMaxRams(result.getInt("maxRams"));
	    computerType.setPrice(result.getInt("price"));
	    
		return computerType;
	}

}
